#ifndef ACTIVATION_H
#define ACTIVATION_H

#include <cmath>

class Activation {
public:
    /**
     * @brief function
     * @param {const double&} input
     * @return {const double&}
     */
    virtual double function(const double& n) const {
        return n;
    }

    /**
     * @brief derivative
     * @param {const double&} input
     * @return {const double&}
     */
    virtual double derivative(const double& n, const double& fn) const {
        (void)fn;
        return n;
    }
};

class LogisticActivation: public Activation {
public:
    virtual double function(const double &n) const {
        return 1.0/(1.0 + exp(-n));
    }

    virtual double derivative(const double& n, const double& fn) const {
        (void)n;
        return fn*(1-fn);
    }
};


#endif // ACTIVATION_H
